const b2 = Buffer.from("1");
const b3 = Buffer.from([1]);
// console.log(b2);
// console.log(b3);

ArrayBuffer.prototype.split = function (sep) {
  let buf = Buffer.from(sep);
  let result = [];
  let start = 0,
    offset = 0;
  let len = buf.length;

  while (this.indexOf(sep, start) !== -1) {
    offset = this.indexOf(sep, start);
    result.push(this.slice(start, offset));
    start = offset + len;
  }
  result.push(this.slice(start));
  return result;
};

const testBuf = "王斯晴爱王鹏博爱王嘻嘻";
console.log(testBuf.split("爱"));
